package com.pcbly.web.persistence.config;

import java.util.List;


import com.pcbly.web.bean.system.ConfigBean;
import com.pcbly.web.persistence.HibernateBaseDao;

public class ConfigHibernateDao extends HibernateBaseDao<ConfigBean>
		implements ConfigDao {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6151148046929457091L;
	public ConfigHibernateDao(){
		super();
	}
	protected Class<ConfigBean> getEntityClass() {
        return ConfigBean.class;
    }
	@Override
	public ConfigBean findConfigByID(String id) throws Exception {
		// TODO Auto-generated method stub
		return (ConfigBean) getHibernateTemplate().get(ConfigBean.class, id);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<ConfigBean> findConfigs() throws Exception {
		// TODO Auto-generated method stub
		return getHibernateTemplate().find("from ConfigBean");
	}

	@Override
	public ConfigBean updateConfig(ConfigBean config) throws Exception {
		// TODO Auto-generated method stub
		getHibernateTemplate().update(config);
		return config;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
